﻿@inherits Statiq.Razor.StatiqRazorPage<IEnumerable<IDocument>>

@foreach (IDocument candidate in Model)
{
    <article class="card">
        <header class="card__title">
            <h3>@candidate.GetString(WebKeys.Title)</h3>
        </header>
        <figure class="card__thumbnail">
            @if (!String.IsNullOrEmpty(candidate.GetString(SiteKeys.Image)))
            {
                if (candidate.GetString(SiteKeys.Image).StartsWith("http"))
                {
                    <img src="@candidate.GetString(SiteKeys.Image)" alt="@candidate.GetString(WebKeys.Title)"/>
                }
                else
                {
                    <img src="assets/members/@candidate.GetString(SiteKeys.Image)" alt="@candidate.GetString(WebKeys.Title)"/>
                }
            }
            else
            {
                <img src="img/dot_bot.png" alt="Default Dot Bot Image"/>
            }

            @if (!string.IsNullOrEmpty(candidate.GetString(SiteKeys.Twitter)))
        {
            <figcaption>
                <a href="https://twitter.com/@candidate.GetString(SiteKeys.Twitter)">
                    <i class="fab fa-twitter" aria-hidden="true"></i>
                    @@@candidate.GetString(SiteKeys.Twitter)
                </a>
            </figcaption>
        }
        </figure>
        
        <a href="@Context.GetLink(candidate).Substring(1)" class="card__button">Learn More</a>
    </article>
}